<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Map</title>
</head>
<body>
    <script>
        //声明 map
        let m = new Map();
        //添加元素
        m.set('name','轩溪说');
        m.set('change',function(){
            console.log('我们可以改变你');
        })
        let key = { school: 'Aiguigu'};
        m.set(key,['beijing','shanghai','shengzhen']);
        console.log(m);  
        //查询元素个数
        console.log(m.size);
        //根据键名获取键值
        console.log(m.get('change'));
        //判断是否包含元素
        console.log(m.has('name'));
        //删除元素
        //m.delete('name');
        //清空 Map
        //m.clear();
        console.log(m);    
        // 遍历
        for(let v of m){
            console.log('遍历：'+v);
        }
        
    </script>
</body>
</html>